<html layout:decorator="public/layout" xmlns:miguo="http://www.w3.org/1999/html">
<div layout:fragment="content">

    <!-- 表格工具栏 -->
    <form class="layui-form toolbar">
        <div class="layui-form-item">
            <!-- 是否热卖下拉单选 -->
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <widget:singleSelect name="isHot|0|是否热卖|name|id" th:data="${PRODUCT_ISHOT_LIST}" value="0"/>
                </div>
            </div>
            <!-- 是否新品下拉单选 -->
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <widget:singleSelect name="isNew|0|是否新品|name|id" th:data="${PRODUCT_ISNEW_LIST}" value="0"/>
                </div>
            </div>
            <!-- 审核状态下拉单选 -->
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <widget:singleSelect name="verifyStatus|0|审核状态|name|id" th:data="${PRODUCT_VERIFYSTATUS_LIST}" value="0"/>
                </div>
            </div>
            <!-- 上架状态下拉单选 -->
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <widget:singleSelect name="status|0|上架状态|name|id" th:data="${PRODUCT_STATUS_LIST}" value="0"/>
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-inline" style="width: auto;">
                    <widget:btnQuery name="查询"/>
                    <widget:btnAdd shiro:hasPermission="sys:product:add" name="添加商品"/>
                    <widget:btnDAll shiro:hasPermission="sys:product:dall" name="批量删除"/>
                </div>
            </div>
        </div>
    </form>

    <!-- 数据表格 -->
    <table class="layui-hide" id="tableList" lay-filter="tableList"></table>

    <!-- 表格操作列 -->
    <script type="text/html" id="toolBar">
        <widget:btnEdit shiro:hasPermission="sys:product:update" name="编辑"/>
        <widget:btnDel shiro:hasPermission="sys:product:delete" name="删除"/>
    </script>

    <!-- 商品状态 -->
    <script type="text/html" id="statusTpl">
        <input type="checkbox" name="status" value="{{ d.id }}" lay-skin="switch" lay-text="已上架|已下架" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }} >
    </script>

    <!-- 审核状态 -->
    <script type="text/html" id="verifyStatusTpl">
        {{# if(d.verifyStatus==2){ }}
        <span style="color: orange;cursor: default;" lay-tips="正在审核中，请耐心等待">待审核</span>
        {{# }else if(d.verifyStatus==1){ }}
        <span class="icon-text" style="color: green;cursor: pointer;" lay-event="checkList">
        已通过<i class="layui-icon layui-icon-tips"></i>
    </span>
        {{# } }}
    </script>
</div>
</html>